﻿<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script type="text/javascript" language="javascript" src="/scripts/library.js"></script>
	<style type="text/css">
body{font:8pt tahoma,arial,sans-serif;margin:0;background:#E9E8F2;color:#444444}
.dialogFooter{background-color:#E2E2ED;border-top:#CFCFCF 1px solid;}
td{font-size:8pt}
input {font:8pt tahoma,arial,sans-serif}
select {font:8pt tahoma,arial,sans-serif}
textarea {font:8pt tahoma,arial,sans-serif}
.inpSel {font:8pt tahoma,arial,sans-serif}
.inpTxt {font:8pt tahoma,arial,sans-serif;} 
.inpChk {width:13;height:13;margin-right:3;margin-bottom:1}
.inpRdo {width:13;height:13;margin-right:3;margin-bottom:1}
.inpBtn {font:8pt tahoma,arial,sans-serif;}
.inpBtnOver {}
.inpBtnOut {}
</style>

	<script type="text/javascript" src="js/swfobject.packed.js"></script>

	<script type="text/javascript">
function openAsset()
	{		
	    if(navigator.appName.indexOf('Microsoft')!=-1)
	    {
	        document.getElementById("inpFlvURL").value = eval(dialogArguments.oUtil.obj.cmdAssetManager);	        
	    }
	    else//FF
	    {        
	       eval(window.opener.oUtil.obj.cmdAssetManager);        
	    }
	}
function modalDialogShow(url,width,height)
{
    if(navigator.appName.indexOf('Microsoft')!=-1)//IE
    {	
        return window.showModalDialog(url,window,
	        "dialogWidth:"+width+"px;dialogHeight:"+height+"px;edge:Raised;center:Yes;help:No;Resizable:Yes;Maximize:Yes");
    }
    else//FF
    {
         var left = screen.availWidth/2 - width/2;
         var top = screen.availHeight/2 - height/2;
         activeModalWin = window.open(url, "", "width="+width+"px,height="+height+",left="+left+",top="+top);
         window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
    }
}
function setAssetValue(v)//FF 
    {
        document.getElementById("inpFlvURL").value = v;
    }
    
function clearAllProperties()
	{
	document.getElementById("inpFlvURL").value="";
	document.getElementById("inpFlvWidth").value=365;
	document.getElementById("inpFlvHeight").value=255;
	}
function insertObject(sHTML)
	{
	if(navigator.appName.indexOf('Microsoft')!=-1)
		{
		//Use dialogArguments.oUtil.obj to get editor object for IE version
		//-----------------------------------------------------------------
		var obj=dialogArguments.oUtil.obj;
		}
	else
		{
		//Use window.opener.oUtil.obj to get editor object for Mozilla version
		//--------------------------------------------------------------------
		var obj=window.opener.oUtil.obj;
		}
	
	//Use insertHTML() function to insert your custom html	
	obj.insertHTML(sHTML);
	}

function doPreview()
{  
    var sHTML = '<p id="FlashPlayer144" class="Normal" align="center">'+ 
	            '<img src="/AssetManager/CustomObjects/images/MediaPlayer.GIF" width="'+ document.getElementById("inpFlvWidth").value +'" height="'+ document.getElementById("inpFlvHeight").value +'" />' +
	            '<br>Bạn cài  <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> để xem được Clip này.</p>';
	document.getElementById("objPreview").innerHTML = sHTML;             
    
    var sFlashPlayer144 = new SWFObject("/Scripts/FLV/flvplayer.swf","playlist",document.getElementById("inpFlvWidth").value,document.getElementById("inpFlvHeight").value,"7");
    sFlashPlayer144.addParam("allowfullscreen","true");
    sFlashPlayer144.addVariable("file","/"+document.getElementById("inpFlvURL").value);
    sFlashPlayer144.addVariable("width",document.getElementById("inpFlvWidth").value);
    sFlashPlayer144.addVariable("height",document.getElementById("inpFlvHeight").value);
     sFlashPlayer144.addVariable("autostart","false");
     sFlashPlayer144.addVariable("wmode","window");
     sFlashPlayer144.addVariable("logo","logoK14.png");
    sFlashPlayer144.write("FlashPlayer144"); 	        	
      
}

function doApply()
{	

var date_now = new Date()
var id = date_now.getDate() + "" + date_now.getMonth() +""+ date_now.getFullYear() +""+ date_now.getHours() +""+ date_now.getMinutes() +""+ date_now.getSeconds() +""+ date_now.getMilliseconds(); 
var sHTML = '<p id="FlashPlayer'+id+'" class="Normal" align="center">'+ 
            '<img src="/AssetManager/CustomObjects/images/MediaPlayer.GIF" width="'+ document.getElementById("inpFlvWidth").value +'" height="'+ document.getElementById("inpFlvHeight").value +'" />' +
            '<br>Bạn cài  <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> để xem được Clip này.</p>' +
            '<script type="text/javascript">' +
            'var sFlashPlayer'+id+' = new SWFObject("'+ document.getElementById("inpSwfObject").value +'","single","'+ document.getElementById("inpFlvWidth").value +'","' + document.getElementById("inpFlvHeight").value + '","7");' +
            'sFlashPlayer'+id+'.addParam("allowfullscreen","true");' +
            'sFlashPlayer'+id+'.addVariable("file","/'+ document.getElementById("inpFlvURL").value +'");' +
            'sFlashPlayer'+id+'.addVariable("width","'+ document.getElementById("inpFlvWidth").value +'");' +
            'sFlashPlayer'+id+'.addVariable("height","'+ document.getElementById("inpFlvHeight").value +'");' +
            'sFlashPlayer'+id+'.addVariable("autostart","false");' +
            'sFlashPlayer'+id+'.addVariable("wmode","window");' +
            'sFlashPlayer'+id+'.addVariable("logo","logoK14.png");' +
	        'sFlashPlayer'+id+'.write("FlashPlayer'+id+'");' + 
	        '<\/script>';		
insertObject(sHTML);

}				
	</script>

	<title>Chèn file FLV</title>
</head>
<body style="overflow: hidden;">
	<table width="100%" height="100%" align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td valign="top" style="padding: 5; height: 100%">
				<table cellpadding="2" cellspacing="0">
					<tr>
						<td width="90px" nowrap>
							<span id="txtLang" name="txtLang">Nguồn</span>:&nbsp;&nbsp;</td>
						<td colspan="4" width="100%">
							<table cellpadding="0" cellspacing="0" width="100%" id="Table2">
								<tr>
									<td width="100%">
										<input type="text" name="inpFlvURL" style="width: 100%" value="" class="inpTxt" id="inpFlvURL"></td>
									<td>
										<img src="/images/icons/folder.gif" onclick="chooseFile('avatar')" style="cursor: pointer;" /></td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td nowrap>
							<span id="Span1" name="txtLang">Chiều ngang</span>:</td>
						<td colspan="4">
							<input type="text" name="inpFlvWidth" id="inpFlvWidth" value="365" size="4" class="inpTxt"></td>
					</tr>
					<tr>
						<td nowrap>
							<span id="Span2" name="txtLang">Chiều cao</span>:</td>
						<td colspan="4">
							<input type="text" name="inpFlvHeight" id="inpFlvHeight" value="255" size="4" class="inpTxt"><input
								type="button" value="xem trước" class="inpBtn" onclick="doPreview()" /></td>
					</tr>
				</table>
				<!-- hidden -->
				<table style="display: none" id="tblAdvance" cellpadding="2" cellspacing="0">
					<tr>
						<td nowrap style="height: 25px">
							Script:</td>
						<td style="height: 25px">
							<input type="text" name="inpFlvScript" size="50" class="inpTxt" value='' /></td>
					</tr>
					<tr style="display: none">
						<td nowrap>
							Message:</td>
						<td>
							<input type="text" name="inpFlvMesage" size="50" value='' class="inpTxt"></td>
					</tr>
					<tr style="display: none">
						<td nowrap>
							<span id="Span3" name="txtLang">Swf Object</span>:</td>
						<td>
							<input type="text" name="inpSwfObject" size="50" value="CustomObjects/mediaplayer.swf"
								class="inpTxt" id="inpSwfObject"></td>
					</tr>
				</table>
				<!-- /hidden -->
				<table style="margin: 0 auto; border: 1px solid #CCCCCC; width: 480px; height: 280px;">
					<tr>
						<td>
							<div style="overflow: auto; width: 480px; height: 280px;" id="objPreview">
								Khung xem trước</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td class="dialogFooter" style="padding: 13; padding-top: 7; padding-bottom: 7;"
				align="right">
				<input type="button" name="btnCancel" id="btnCancel" value="cancel" onclick="self.close()"
					class="inpBtn" onmouseover="this.className='inpBtnOver';" onmouseout="this.className='inpBtnOut'">
				<input type="button" name="btnOk" id="btnOk" value=" ok " onclick="doApply();self.close()"
					class="inpBtn" onmouseover="this.className='inpBtnOver';" onmouseout="this.className='inpBtnOut'">
			</td>
		</tr>
	</table>

	<script type="text/javascript">
	function chooseFile(type)
	{
		openpreview('/GUI/EditoralOffice/MainOffce/FileManager/default.aspx?function=avatar_loadValue&mode=single&share=share', 900, 700);
	}
	function avatar_loadValue(arrImage)
	{
		if (arrImage.length > 0) document.getElementById('inpFlvURL').value = arrImage[0];
	}
	
	</script>

</body>
</html>
